<?php  if (!defined("_ECRIRE_INC_VERSION")) return;
// If at list one function from this file is already defined we won't continue 
if (!function_exists('checkbox_value_convert')) {
/**
 * SPIP Plugin Development Kit
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage pdk
 * @category   outils
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/Developmet-Kit
 * @version    1.0.0
 */

// ------------------------------------------------------------------------

/**
 * Form Functions
 *
 * This file contain functions that will help to work with forms
 *
 * @package		plugins
 * @subpackage	pdk
 * @category	outils
 * @author		Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @link		http://www.spip-contrib.net/Developmet-Kit
 */

// ------------------------------------------------------------------------
/**
 *  Конвертирование значения поля чекбокс, для корректного соответсвия с БД
 */
function checkbox_value_convert($value){
    if (intval($value) === 1) return 'on';    
    if ($value == 'on') return 1;
    return '';
}
// ------------------------------------------------------------------------

// ------------------------------------------------------------------------

// ------------------------------------------------------------------------
}
?>